<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>修改驾校信息</title>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
      function check(){
         //驾校名称：
        var name= $("input[name='ds.name']").val();
         //驾校地址：
        var address= $("input[name='ds.address']").val();
        //驾校电话：
        var phone= $("input[name='ds.phone']").val();
        //验证驾校电话
          var reg=/^0{0,1}(13[0-9]|15[7-9]|153|156|18[7-9])[0-9]{8}$/;
        if(name.length==0){
            alert("驾校名称不能为空");
            return false;
        } 
        if(address.length==0){
            alert("驾校地址不能为空");
            return false;
        } 
        
        if(phone.length==0){
            alert("驾校电话不能为空");
            return false;
        }
        if(reg.test(phone)==false){
           alert("驾校电话格式不正确");
           return false;
        }
        return true;
      }
    </script>

</head>
<body>
	<h1 align="center">驾校信息修改</h1>
	<form action="ds_updatesubmit.action" method="post" onsubmit="return check();">
	<input type="hidden" name="id" value="${ds.id}"/>
		<table align="center" cellpadding="0" cellspacing="0">
			<tr>
				<td>驾校名称:</td>
				<td><input type="text" name="name" value="${ds.name}" />*</td>
			</tr>
			<tr>
				<td>所在城区:</td>
				<td>
				<s:select name="cityarea.id" list="clist" listKey="id"
						listValue="name"  value="id"/>
				</td>
			</tr>
			<tr>
				<td>地址:</td>
				<td><input type="text" name="address" value="${ds.address}" />
				</td>
			</tr>
			<tr>
				<td>联系电话:</td>
				<td><input type="text" name="phone" value="${ds.phone}" />
				</td>
			</tr>
			<tr>
				<td colspan="4" align="right"><br />
				  <input type="submit" value="修改" /> <input type="reset" value="重置" />
				  <input type="button" value="取消" onclick="window.location.href='cityarea_list.action'" /></td>
			</tr>
		</table>
	</form>
</body>
</html>
